home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / graphics.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  35.7 KB  |  904 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Graphics.pas' rev: 3.00
  6.  
  7. #ifndef GraphicsHPP
  8. #define GraphicsHPP
  9. #include <Classes.hpp>
  10. #include <SysUtils.hpp>
  11. #include <Windows.hpp>
  12. #include <SysInit.hpp>
  13. #include <System.hpp>
  14.  
  15. //-- user supplied -----------------------------------------------------------
  16. namespace Graphics
  17. {
  18.   enum TColor {clMin=-0x7fffffff-1, clMax=0x7fffffff};
  19. }
  20. namespace Graphics
  21. {
  22.   enum TFontStyle { fsBold, fsItalic, fsUnderline, fsStrikeOut };
  23.   typedef SmallStringBase<31> TFontDataName;
  24.   typedef SetBase<TFontStyle, fsBold, fsStrikeOut> TFontStylesBase;
  25. }
  26.  
  27. namespace Graphics
  28. {
  29. //-- type declarations -------------------------------------------------------
  30. class DELPHICLASS EInvalidGraphic;
  31. class PASCALIMPLEMENTATION EInvalidGraphic : public Sysutils::Exception 
  32. {
  33.     typedef Sysutils::Exception inherited;
  34.     
  35. public:
  36.     /* Exception.Create */ __fastcall EInvalidGraphic(const System::AnsiString Msg) : Sysutils::Exception(
  37.         Msg) { }
  38.     /* Exception.CreateFmt */ __fastcall EInvalidGraphic(const System::AnsiString Msg, const System::TVarRec 
  39.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  40.     /* Exception.CreateRes */ __fastcall EInvalidGraphic(int Ident, Extended Dummy) : Sysutils::Exception(
  41.         Ident, Dummy) { }
  42.     /* Exception.CreateResFmt */ __fastcall EInvalidGraphic(int Ident, const System::TVarRec * Args, const 
  43.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  44.     /* Exception.CreateHelp */ __fastcall EInvalidGraphic(const System::AnsiString Msg, int AHelpContext
  45.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  46.     /* Exception.CreateFmtHelp */ __fastcall EInvalidGraphic(const System::AnsiString Msg, const System::TVarRec 
  47.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  48.         ) { }
  49.     /* Exception.CreateResHelp */ __fastcall EInvalidGraphic(int Ident, int AHelpContext) : Sysutils::Exception(
  50.         Ident, AHelpContext) { }
  51.     /* Exception.CreateResFmtHelp */ __fastcall EInvalidGraphic(int Ident, const System::TVarRec * Args
  52.         , const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
  53.         ) { }
  54.     
  55. public:
  56.     /* TObject.Destroy */ __fastcall virtual ~EInvalidGraphic(void) { }
  57.     
  58. };
  59.  
  60. class DELPHICLASS EInvalidGraphicOperation;
  61. class PASCALIMPLEMENTATION EInvalidGraphicOperation : public Sysutils::Exception 
  62. {
  63.     typedef Sysutils::Exception inherited;
  64.     
  65. public:
  66.     /* Exception.Create */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg) : Sysutils::
  67.         Exception(Msg) { }
  68.     /* Exception.CreateFmt */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, const System::TVarRec 
  69.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  70.     /* Exception.CreateRes */ __fastcall EInvalidGraphicOperation(int Ident, Extended Dummy) : Sysutils::
  71.         Exception(Ident, Dummy) { }
  72.     /* Exception.CreateResFmt */ __fastcall EInvalidGraphicOperation(int Ident, const System::TVarRec * 
  73.         Args, const int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  74.     /* Exception.CreateHelp */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, int AHelpContext
  75.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  76.     /* Exception.CreateFmtHelp */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, const 
  77.         System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size
  78.         , AHelpContext) { }
  79.     /* Exception.CreateResHelp */ __fastcall EInvalidGraphicOperation(int Ident, int AHelpContext) : Sysutils::
  80.         Exception(Ident, AHelpContext) { }
  81.     /* Exception.CreateResFmtHelp */ __fastcall EInvalidGraphicOperation(int Ident, const System::TVarRec 
  82.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
  83.         ) { }
  84.     
  85. public:
  86.     /* TObject.Destroy */ __fastcall virtual ~EInvalidGraphicOperation(void) { }
  87.     
  88. };
  89.  
  90. struct TResData
  91. {
  92.     int Handle;
  93. } ;
  94.  
  95. enum TFontPitch { fpDefault, fpVariable, fpFixed };
  96.  
  97. typedef System::AnsiString TFontName;
  98.  
  99. typedef Byte TFontCharset;
  100.  
  101. typedef Set<TFontStyle, fsBold, fsStrikeOut>  TFontStyles;
  102.  
  103. struct TFontData
  104. {
  105.     HFONT Handle;
  106.     int Height;
  107.     TFontPitch Pitch;
  108.     TFontStylesBase Style;
  109.     TFontCharset Charset;
  110.     TFontDataName Name;
  111. } ;
  112.  
  113. enum TPenStyle { psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame };
  114.  
  115. enum TPenMode { pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, 
  116.     pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor };
  117.  
  118. struct TPenData
  119. {
  120.     HPEN Handle;
  121.     TColor Color;
  122.     int Width;
  123.     TPenStyle Style;
  124. } ;
  125.  
  126. enum TBrushStyle { bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross 
  127.     };
  128.  
  129. class DELPHICLASS TBitmap;
  130. class DELPHICLASS TGraphic;
  131. enum TProgressStage { psStarting, psRunning, psEnding };
  132.  
  133. typedef void __fastcall (__closure *TProgressEvent)(System::TObject* Sender, TProgressStage Stage, Byte 
  134.     PercentDone, bool RedrawNow, const Windows::TRect &R, const System::AnsiString Msg);
  135.  
  136. class DELPHICLASS TCanvas;
  137. class PASCALIMPLEMENTATION TGraphic : public Classes::TPersistent 
  138. {
  139.     typedef Classes::TPersistent inherited;
  140.     
  141. private:
  142.     Classes::TNotifyEvent FOnChange;
  143.     TProgressEvent FOnProgress;
  144.     bool FModified;
  145.     bool FTransparent;
  146.     bool FPaletteModified;
  147.     void __fastcall SetModified(bool Value);
  148.     
  149. protected:
  150.     __fastcall virtual TGraphic(void);
  151.     virtual void __fastcall Changed(System::TObject* Sender);
  152.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  153.     virtual void __fastcall Draw(TCanvas* ACanvas, const Windows::TRect &Rect) = 0;
  154.     virtual bool __fastcall Equals(TGraphic* Graphic);
  155.     virtual bool __fastcall GetEmpty(void) = 0;
  156.     virtual int __fastcall GetHeight(void) = 0;
  157.     virtual HPALETTE __fastcall GetPalette(void);
  158.     virtual bool __fastcall GetTransparent(void);
  159.     virtual int __fastcall GetWidth(void) = 0;
  160.     DYNAMIC void __fastcall Progress(System::TObject* Sender, TProgressStage Stage, Byte PercentDone, bool 
  161.         RedrawNow, const Windows::TRect &R, const System::AnsiString Msg);
  162.     virtual void __fastcall ReadData(Classes::TStream* Stream);
  163.     virtual void __fastcall SetHeight(int Value) = 0;
  164.     virtual void __fastcall SetPalette(HPALETTE Value);
  165.     virtual void __fastcall SetTransparent(bool Value);
  166.     virtual void __fastcall SetWidth(int Value) = 0;
  167.     virtual void __fastcall WriteData(Classes::TStream* Stream);
  168.     
  169. public:
  170.     virtual void __fastcall LoadFromFile(const System::AnsiString Filename);
  171.     virtual void __fastcall SaveToFile(const System::AnsiString Filename);
  172.     virtual void __fastcall LoadFromStream(Classes::TStream* Stream) = 0;
  173.     virtual void __fastcall SaveToStream(Classes::TStream* Stream) = 0;
  174.     virtual void __fastcall LoadFromClipboardFormat(Word AFormat, int AData, HPALETTE APalette) = 0;
  175.     virtual void __fastcall SaveToClipboardFormat(Word &AFormat, int &AData, HPALETTE &APalette) = 0;
  176.     __property bool Empty = {read=GetEmpty, nodefault};
  177.     __property int Height = {read=GetHeight, write=SetHeight, nodefault};
  178.     __property bool Modified = {read=FModified, write=SetModified, nodefault};
  179.     __property HPALETTE Palette = {read=GetPalette, write=SetPalette, nodefault};
  180.     __property bool PaletteModified = {read=FPaletteModified, write=FPaletteModified, nodefault};
  181.     __property bool Transparent = {read=GetTransparent, write=SetTransparent, nodefault};
  182.     __property int Width = {read=GetWidth, write=SetWidth, nodefault};
  183.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  184.     __property TProgressEvent OnProgress = {read=FOnProgress, write=FOnProgress};
  185. public:
  186.     /* TPersistent.Destroy */ __fastcall virtual ~TGraphic(void) { }
  187.     
  188. };
  189.  
  190. class DELPHICLASS TBitmapImage;
  191. class DELPHICLASS TSharedImage;
  192. class PASCALIMPLEMENTATION TSharedImage : public System::TObject 
  193. {
  194.     typedef System::TObject inherited;
  195.     
  196. private:
  197.     int FRefCount;
  198.     
  199. protected:
  200.     void __fastcall Reference(void);
  201.     void __fastcall Release(void);
  202.     virtual void __fastcall FreeHandle(void) = 0;
  203.     __property int RefCount = {read=FRefCount, nodefault};
  204. public:
  205.     /* TObject.Create */ __fastcall TSharedImage(void) : System::TObject() { }
  206.     /* TObject.Destroy */ __fastcall virtual ~TSharedImage(void) { }
  207.     
  208. };
  209.  
  210. class PASCALIMPLEMENTATION TBitmapImage : public Graphics::TSharedImage 
  211. {
  212.     typedef Graphics::TSharedImage inherited;
  213.     
  214. private:
  215.     HBITMAP FHandle;
  216.     HBITMAP FMaskHandle;
  217.     HPALETTE FPalette;
  218.     HBITMAP FDIBHandle;
  219.     tagDIBSECTION FDIB;
  220.     bool FOS2Format;
  221.     bool FHalftone;
  222.     
  223. protected:
  224.     __fastcall virtual ~TBitmapImage(void);
  225.     virtual void __fastcall FreeHandle(void);
  226. public:
  227.     /* TObject.Create */ __fastcall TBitmapImage(void) : Graphics::TSharedImage() { }
  228.     
  229. };
  230.  
  231. enum TTransparentMode { tmAuto, tmFixed };
  232.  
  233. enum TBitmapHandleType { bmDIB, bmDDB };
  234.  
  235. enum TPixelFormat { pfDevice, pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit, pf32bit, pfCustom }
  236.     ;
  237.  
  238. class PASCALIMPLEMENTATION TBitmap : public Graphics::TGraphic 
  239. {
  240.     typedef Graphics::TGraphic inherited;
  241.     
  242. private:
  243.     TBitmapImage* FImage;
  244.     TCanvas* FCanvas;
  245.     bool FIgnorePalette;
  246.     bool FMaskBitsValid;
  247.     bool FMaskValid;
  248.     TColor FTransparentColor;
  249.     TTransparentMode FTransparentMode;
  250.     void __fastcall Changing(System::TObject* Sender);
  251.     void __fastcall CopyImage(HBITMAP AHandle, HPALETTE APalette, const tagDIBSECTION &DIB);
  252.     void __fastcall DIBNeeded(void);
  253.     void __fastcall FreeContext(void);
  254.     TCanvas* __fastcall GetCanvas(void);
  255.     virtual HBITMAP __fastcall GetHandle(void);
  256.     TBitmapHandleType __fastcall GetHandleType(void);
  257.     virtual HBITMAP __fastcall GetMaskHandle(void);
  258.     bool __fastcall GetMonochrome(void);
  259.     TPixelFormat __fastcall GetPixelFormat(void);
  260.     void * __fastcall GetScanline(int Row);
  261.     TColor __fastcall GetTransparentColor(void);
  262.     void __fastcall NewImage(HBITMAP NewHandle, HPALETTE NewPalette, const tagDIBSECTION &NewDIB, bool 
  263.         OS2Format);
  264.     void __fastcall ReadStream(Classes::TStream* Stream, int Size);
  265.     void __fastcall ReadDIB(Classes::TStream* Stream, int ImageSize);
  266.     void __fastcall SetHandle(HBITMAP Value);
  267.     virtual void __fastcall SetHandleType(TBitmapHandleType Value);
  268.     void __fastcall SetMonochrome(bool Value);
  269.     void __fastcall SetPixelFormat(TPixelFormat Value);
  270.     void __fastcall SetTransparentColor(TColor Value);
  271.     void __fastcall SetTransparentMode(TTransparentMode Value);
  272.     bool __fastcall TransparentColorStored(void);
  273.     void __fastcall WriteStream(Classes::TStream* Stream, bool WriteSize);
  274.     
  275. protected:
  276.     virtual void __fastcall Changed(System::TObject* Sender);
  277.     virtual void __fastcall Draw(TCanvas* ACanvas, const Windows::TRect &Rect);
  278.     virtual bool __fastcall GetEmpty(void);
  279.     virtual int __fastcall GetHeight(void);
  280.     virtual HPALETTE __fastcall GetPalette(void);
  281.     virtual int __fastcall GetWidth(void);
  282.     void __fastcall HandleNeeded(void);
  283.     void __fastcall MaskHandleNeeded(void);
  284.     void __fastcall PaletteNeeded(void);
  285.     virtual void __fastcall ReadData(Classes::TStream* Stream);
  286.     virtual void __fastcall SetHeight(int Value);
  287.     virtual void __fastcall SetPalette(HPALETTE Value);
  288.     virtual void __fastcall SetWidth(int Value);
  289.     virtual void __fastcall WriteData(Classes::TStream* Stream);
  290.     
  291. public:
  292.     __fastcall virtual TBitmap(void);
  293.     __fastcall virtual ~TBitmap(void);
  294.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  295.     void __fastcall Dormant(void);
  296.     void __fastcall FreeImage(void);
  297.     virtual void __fastcall LoadFromClipboardFormat(Word AFormat, int AData, HPALETTE APalette);
  298.     virtual void __fastcall LoadFromStream(Classes::TStream* Stream);
  299.     void __fastcall LoadFromResourceName(int Instance, const System::AnsiString ResName);
  300.     void __fastcall LoadFromResourceID(int Instance, int ResID);
  301.     void __fastcall Mask(TColor TransparentColor);
  302.     HBITMAP __fastcall ReleaseHandle(void);
  303.     HBITMAP __fastcall ReleaseMaskHandle(void);
  304.     HPALETTE __fastcall ReleasePalette(void);
  305.     virtual void __fastcall SaveToClipboardFormat(Word &Format, int &Data, HPALETTE &APalette);
  306.     virtual void __fastcall SaveToStream(Classes::TStream* Stream);
  307.     __property TCanvas* Canvas = {read=GetCanvas};
  308.     __property HBITMAP Handle = {read=GetHandle, write=SetHandle, nodefault};
  309.     __property TBitmapHandleType HandleType = {read=GetHandleType, write=SetHandleType, nodefault};
  310.     __property bool IgnorePalette = {read=FIgnorePalette, write=FIgnorePalette, nodefault};
  311.     __property HBITMAP MaskHandle = {read=GetMaskHandle, nodefault};
  312.     __property bool Monochrome = {read=GetMonochrome, write=SetMonochrome, nodefault};
  313.     __property TPixelFormat PixelFormat = {read=GetPixelFormat, write=SetPixelFormat, nodefault};
  314.     __property void * ScanLine[int Row] = {read=GetScanline};
  315.     __property TColor TransparentColor = {read=GetTransparentColor, write=SetTransparentColor, stored=TransparentColorStored
  316.         , nodefault};
  317.     __property TTransparentMode TransparentMode = {read=FTransparentMode, write=SetTransparentMode, default=0
  318.         };
  319. };
  320.  
  321. struct TBrushData
  322. {
  323.     HBRUSH Handle;
  324.     TColor Color;
  325.     TBitmap* Bitmap;
  326.     TBrushStyle Style;
  327. } ;
  328.  
  329. struct TResource;
  330. typedef TResource *PResource;
  331.  
  332. struct TResource
  333. {
  334.     TResource *Next;
  335.     int RefCount;
  336.     int Handle;
  337.     Word HashCode;
  338.     union
  339.     {
  340.         TBrushData Brush;
  341.         TPenData Pen;
  342.         TFontData Font;
  343.         TResData Data;
  344.         
  345.     };
  346. } ;
  347.  
  348. class DELPHICLASS TGraphicsObject;
  349. class PASCALIMPLEMENTATION TGraphicsObject : public Classes::TPersistent 
  350. {
  351.     typedef Classes::TPersistent inherited;
  352.     
  353. private:
  354.     Classes::TNotifyEvent FOnChange;
  355.     TResource *FResource;
  356.     _RTL_CRITICAL_SECTION *FOwnerLock;
  357.     
  358. protected:
  359.     DYNAMIC void __fastcall Changed(void);
  360.     void __fastcall Lock(void);
  361.     void __fastcall Unlock(void);
  362.     
  363. public:
  364.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  365.     __property Windows::PRTLCriticalSection OwnerCriticalSection = {read=FOwnerLock, write=FOwnerLock};
  366.         
  367. public:
  368.     /* TPersistent.Destroy */ __fastcall virtual ~TGraphicsObject(void) { }
  369.     
  370. public:
  371.     /* TObject.Create */ __fastcall TGraphicsObject(void) : Classes::TPersistent() { }
  372.     
  373. };
  374.  
  375. __interface IChangeNotifier;
  376. typedef System::DelphiInterface<IChangeNotifier> _di_IChangeNotifier;
  377. __interface IChangeNotifier : public IUnknown /* __guid="{1FB62321-44A7-11D0-9E93-0020AF3D82DA}" */
  378. {
  379.     
  380. public:
  381.     virtual void __fastcall Changed(void) = 0;
  382. };
  383.  
  384. class DELPHICLASS TFont;
  385. class PASCALIMPLEMENTATION TFont : public Graphics::TGraphicsObject 
  386. {
  387.     typedef Graphics::TGraphicsObject inherited;
  388.     
  389. private:
  390.     TColor FColor;
  391.     int FPixelsPerInch;
  392.     _di_IChangeNotifier FNotify;
  393.     void __fastcall GetData(TFontData &FontData);
  394.     void __fastcall SetData(const TFontData &FontData);
  395.     
  396. protected:
  397.     DYNAMIC void __fastcall Changed(void);
  398.     HFONT __fastcall GetHandle(void);
  399.     int __fastcall GetHeight(void);
  400.     System::AnsiString __fastcall GetName(void);
  401.     TFontPitch __fastcall GetPitch(void);
  402.     int __fastcall GetSize(void);
  403.     TFontStyles __fastcall GetStyle(void);
  404.     TFontCharset __fastcall GetCharset(void);
  405.     void __fastcall SetColor(TColor Value);
  406.     void __fastcall SetHandle(HFONT Value);
  407.     void __fastcall SetHeight(int Value);
  408.     void __fastcall SetName(const System::AnsiString Value);
  409.     void __fastcall SetPitch(TFontPitch Value);
  410.     void __fastcall SetSize(int Value);
  411.     void __fastcall SetStyle(TFontStyles Value);
  412.     void __fastcall SetCharset(TFontCharset Value);
  413.     
  414. public:
  415.     __fastcall TFont(void);
  416.     __fastcall virtual ~TFont(void);
  417.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  418.     __property _di_IChangeNotifier FontAdapter = {read=FNotify, write=FNotify};
  419.     __property HFONT Handle = {read=GetHandle, write=SetHandle, nodefault};
  420.     __property int PixelsPerInch = {read=FPixelsPerInch, write=FPixelsPerInch, nodefault};
  421.     
  422. __published:
  423.     __property TFontCharset Charset = {read=GetCharset, write=SetCharset, nodefault};
  424.     __property TColor Color = {read=FColor, write=SetColor, nodefault};
  425.     __property int Height = {read=GetHeight, write=SetHeight, nodefault};
  426.     __property System::AnsiString Name = {read=GetName, write=SetName};
  427.     __property TFontPitch Pitch = {read=GetPitch, write=SetPitch, default=0};
  428.     __property int Size = {read=GetSize, write=SetSize, stored=false, nodefault};
  429.     __property TFontStyles Style = {read=GetStyle, write=SetStyle, nodefault};
  430. };
  431.  
  432. class DELPHICLASS TPen;
  433. class PASCALIMPLEMENTATION TPen : public Graphics::TGraphicsObject 
  434. {
  435.     typedef Graphics::TGraphicsObject inherited;
  436.     
  437. private:
  438.     TPenMode FMode;
  439.     void __fastcall GetData(TPenData &PenData);
  440.     void __fastcall SetData(const TPenData &PenData);
  441.     
  442. protected:
  443.     TColor __fastcall GetColor(void);
  444.     void __fastcall SetColor(TColor Value);
  445.     HPEN __fastcall GetHandle(void);
  446.     void __fastcall SetHandle(HPEN Value);
  447.     void __fastcall SetMode(TPenMode Value);
  448.     TPenStyle __fastcall GetStyle(void);
  449.     void __fastcall SetStyle(TPenStyle Value);
  450.     int __fastcall GetWidth(void);
  451.     void __fastcall SetWidth(int Value);
  452.     
  453. public:
  454.     __fastcall TPen(void);
  455.     __fastcall virtual ~TPen(void);
  456.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  457.     __property HPEN Handle = {read=GetHandle, write=SetHandle, nodefault};
  458.     
  459. __published:
  460.     __property TColor Color = {read=GetColor, write=SetColor, default=0};
  461.     __property TPenMode Mode = {read=FMode, write=SetMode, default=4};
  462.     __property TPenStyle Style = {read=GetStyle, write=SetStyle, default=0};
  463.     __property int Width = {read=GetWidth, write=SetWidth, default=1};
  464. };
  465.  
  466. class DELPHICLASS TBrush;
  467. class PASCALIMPLEMENTATION TBrush : public Graphics::TGraphicsObject 
  468. {
  469.     typedef Graphics::TGraphicsObject inherited;
  470.     
  471. private:
  472.     void __fastcall GetData(TBrushData &BrushData);
  473.     void __fastcall SetData(const TBrushData &BrushData);
  474.     
  475. protected:
  476.     TBitmap* __fastcall GetBitmap(void);
  477.     void __fastcall SetBitmap(TBitmap* Value);
  478.     TColor __fastcall GetColor(void);
  479.     void __fastcall SetColor(TColor Value);
  480.     HBRUSH __fastcall GetHandle(void);
  481.     void __fastcall SetHandle(HBRUSH Value);
  482.     TBrushStyle __fastcall GetStyle(void);
  483.     void __fastcall SetStyle(TBrushStyle Value);
  484.     
  485. public:
  486.     __fastcall TBrush(void);
  487.     __fastcall virtual ~TBrush(void);
  488.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  489.     __property TBitmap* Bitmap = {read=GetBitmap, write=SetBitmap};
  490.     __property HBRUSH Handle = {read=GetHandle, write=SetHandle, nodefault};
  491.     
  492. __published:
  493.     __property TColor Color = {read=GetColor, write=SetColor, default=16777215};
  494.     __property TBrushStyle Style = {read=GetStyle, write=SetStyle, default=0};
  495. };
  496.  
  497. enum TFillStyle { fsSurface, fsBorder };
  498.  
  499. enum TFillMode { fmAlternate, fmWinding };
  500.  
  501. typedef int TCopyMode;
  502.  
  503. enum TCanvasStates { csHandleValid, csFontValid, csPenValid, csBrushValid };
  504.  
  505. typedef Set<TCanvasStates, csHandleValid, csBrushValid>  TCanvasState;
  506.  
  507. class PASCALIMPLEMENTATION TCanvas : public Classes::TPersistent 
  508. {
  509.     typedef Classes::TPersistent inherited;
  510.     
  511. private:
  512.     HDC FHandle;
  513.     TCanvasState State;
  514.     TFont* FFont;
  515.     TPen* FPen;
  516.     TBrush* FBrush;
  517.     tagPOINT FPenPos;
  518.     int FCopyMode;
  519.     Classes::TNotifyEvent FOnChange;
  520.     Classes::TNotifyEvent FOnChanging;
  521.     _RTL_CRITICAL_SECTION FLock;
  522.     int FLockCount;
  523.     void __fastcall CreateBrush(void);
  524.     void __fastcall CreateFont(void);
  525.     void __fastcall CreatePen(void);
  526.     void __fastcall BrushChanged(System::TObject* ABrush);
  527.     void __fastcall DeselectHandles(void);
  528.     Windows::TRect __fastcall GetClipRect(void);
  529.     HDC __fastcall GetHandle(void);
  530.     tagPOINT __fastcall GetPenPos(void);
  531.     TColor __fastcall GetPixel(int X, int Y);
  532.     void __fastcall FontChanged(System::TObject* AFont);
  533.     void __fastcall PenChanged(System::TObject* APen);
  534.     void __fastcall SetBrush(TBrush* Value);
  535.     void __fastcall SetFont(TFont* Value);
  536.     void __fastcall SetHandle(HDC Value);
  537.     void __fastcall SetPen(TPen* Value);
  538.     void __fastcall SetPenPos(const tagPOINT &Value);
  539.     void __fastcall SetPixel(int X, int Y, TColor Value);
  540.     
  541. protected:
  542.     virtual void __fastcall Changed(void);
  543.     virtual void __fastcall Changing(void);
  544.     virtual void __fastcall CreateHandle(void);
  545.     void __fastcall RequiredState(TCanvasState ReqState);
  546.     
  547. public:
  548.     __fastcall TCanvas(void);
  549.     __fastcall virtual ~TCanvas(void);
  550.     void __fastcall Arc(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);
  551.     void __fastcall BrushCopy(const Windows::TRect &Dest, TBitmap* Bitmap, const Windows::TRect &Source
  552.         , TColor Color);
  553.     void __fastcall Chord(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);
  554.     void __fastcall CopyRect(const Windows::TRect &Dest, TCanvas* Canvas, const Windows::TRect &Source)
  555.         ;
  556.     void __fastcall Draw(int X, int Y, TGraphic* Graphic);
  557.     void __fastcall DrawFocusRect(const Windows::TRect &Rect);
  558.     void __fastcall Ellipse(int X1, int Y1, int X2, int Y2);
  559.     void __fastcall FillRect(const Windows::TRect &Rect);
  560.     void __fastcall FloodFill(int X, int Y, TColor Color, TFillStyle FillStyle);
  561.     void __fastcall FrameRect(const Windows::TRect &Rect);
  562.     void __fastcall LineTo(int X, int Y);
  563.     void __fastcall Lock(void);
  564.     void __fastcall MoveTo(int X, int Y);
  565.     void __fastcall Pie(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);
  566.     void __fastcall Polygon(const tagPOINT * Points, const int Points_Size);
  567.     void __fastcall Polyline(const tagPOINT * Points, const int Points_Size);
  568.     void __fastcall PolyBezier(const tagPOINT * Points, const int Points_Size);
  569.     void __fastcall PolyBezierTo(const tagPOINT * Points, const int Points_Size);
  570.     void __fastcall Rectangle(int X1, int Y1, int X2, int Y2);
  571.     void __fastcall Refresh(void);
  572.     void __fastcall RoundRect(int X1, int Y1, int X2, int Y2, int X3, int Y3);
  573.     void __fastcall StretchDraw(const Windows::TRect &Rect, TGraphic* Graphic);
  574.     tagSIZE __fastcall TextExtent(const System::AnsiString Text);
  575.     int __fastcall TextHeight(const System::AnsiString Text);
  576.     void __fastcall TextOut(int X, int Y, const System::AnsiString Text);
  577.     void __fastcall TextRect(const Windows::TRect &Rect, int X, int Y, const System::AnsiString Text);
  578.     int __fastcall TextWidth(const System::AnsiString Text);
  579.     bool __fastcall TryLock(void);
  580.     void __fastcall Unlock(void);
  581.     __property Windows::TRect ClipRect = {read=GetClipRect};
  582.     __property HDC Handle = {read=GetHandle, write=SetHandle, nodefault};
  583.     __property int LockCount = {read=FLockCount, nodefault};
  584.     __property tagPOINT PenPos = {read=GetPenPos, write=SetPenPos};
  585.     __property TColor Pixels[int X][int Y] = {read=GetPixel, write=SetPixel};
  586.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  587.     __property Classes::TNotifyEvent OnChanging = {read=FOnChanging, write=FOnChanging};
  588.     
  589. __published:
  590.     __property TBrush* Brush = {read=FBrush, write=SetBrush};
  591.     __property int CopyMode = {read=FCopyMode, write=FCopyMode, default=13369376};
  592.     __property TFont* Font = {read=FFont, write=SetFont};
  593.     __property TPen* Pen = {read=FPen, write=SetPen};
  594. };
  595.  
  596. typedef System::TMetaClass*TGraphicClass;
  597.  
  598. class DELPHICLASS TPicture;
  599. class DELPHICLASS TIcon;
  600. class DELPHICLASS TMetafile;
  601. class PASCALIMPLEMENTATION TPicture : public Classes::TPersistent 
  602. {
  603.     typedef Classes::TPersistent inherited;
  604.     
  605. private:
  606.     TGraphic* FGraphic;
  607.     Classes::TNotifyEvent FOnChange;
  608.     _di_IChangeNotifier FNotify;
  609.     TProgressEvent FOnProgress;
  610.     void __fastcall ForceType(System::TMetaClass* GraphicType);
  611.     TBitmap* __fastcall GetBitmap(void);
  612.     int __fastcall GetHeight(void);
  613.     TIcon* __fastcall GetIcon(void);
  614.     TMetafile* __fastcall GetMetafile(void);
  615.     int __fastcall GetWidth(void);
  616.     void __fastcall ReadData(Classes::TStream* Stream);
  617.     void __fastcall SetBitmap(TBitmap* Value);
  618.     void __fastcall SetGraphic(TGraphic* Value);
  619.     void __fastcall SetIcon(TIcon* Value);
  620.     void __fastcall SetMetafile(TMetafile* Value);
  621.     void __fastcall WriteData(Classes::TStream* Stream);
  622.     
  623. protected:
  624.     virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
  625.     DYNAMIC void __fastcall Changed(System::TObject* Sender);
  626.     DYNAMIC void __fastcall Progress(System::TObject* Sender, TProgressStage Stage, Byte PercentDone, bool 
  627.         RedrawNow, const Windows::TRect &R, const System::AnsiString Msg);
  628.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  629.     
  630. public:
  631.     __fastcall TPicture(void);
  632.     __fastcall virtual ~TPicture(void);
  633.     void __fastcall LoadFromFile(const System::AnsiString Filename);
  634.     void __fastcall SaveToFile(const System::AnsiString Filename);
  635.     void __fastcall LoadFromClipboardFormat(Word AFormat, int AData, HPALETTE APalette);
  636.     void __fastcall SaveToClipboardFormat(Word &AFormat, int &AData, HPALETTE &APalette);
  637.     /*         class method */ static bool __fastcall SupportsClipboardFormat(System::TMetaClass* vmt, 
  638.         Word AFormat);
  639.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  640.     /*         class method */ static void __fastcall RegisterFileFormat(System::TMetaClass* vmt, const 
  641.         System::AnsiString AExtension, const System::AnsiString ADescription, System::TMetaClass* AGraphicClass
  642.         );
  643.     /*         class method */ static void __fastcall RegisterFileFormatRes(System::TMetaClass* vmt, const 
  644.         System::AnsiString AExtension, int ADescriptionResID, System::TMetaClass* AGraphicClass);
  645.     /*         class method */ static void __fastcall RegisterClipboardFormat(System::TMetaClass* vmt, 
  646.         Word AFormat, System::TMetaClass* AGraphicClass);
  647.     /*         class method */ static void __fastcall UnregisterGraphicClass(System::TMetaClass* vmt, System::TMetaClass* 
  648.         AClass);
  649.     __property TBitmap* Bitmap = {read=GetBitmap, write=SetBitmap};
  650.     __property TGraphic* Graphic = {read=FGraphic, write=SetGraphic};
  651.     __property _di_IChangeNotifier PictureAdapter = {read=FNotify, write=FNotify};
  652.     __property int Height = {read=GetHeight, nodefault};
  653.     __property TIcon* Icon = {read=GetIcon, write=SetIcon};
  654.     __property TMetafile* Metafile = {read=GetMetafile, write=SetMetafile};
  655.     __property int Width = {read=GetWidth, nodefault};
  656.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  657.     __property TProgressEvent OnProgress = {read=FOnProgress, write=FOnProgress};
  658. };
  659.  
  660. class DELPHICLASS TMetafileCanvas;
  661. class PASCALIMPLEMENTATION TMetafileCanvas : public Graphics::TCanvas 
  662. {
  663.     typedef Graphics::TCanvas inherited;
  664.     
  665. private:
  666.     TMetafile* FMetafile;
  667.     
  668. public:
  669.     __fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice);
  670.     __fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice, const System::AnsiString CreatedBy
  671.         , const System::AnsiString Description);
  672.     __fastcall virtual ~TMetafileCanvas(void);
  673. };
  674.  
  675. class DELPHICLASS TMetafileImage;
  676. class PASCALIMPLEMENTATION TMetafileImage : public Graphics::TSharedImage 
  677. {
  678.     typedef Graphics::TSharedImage inherited;
  679.     
  680. private:
  681.     int FHandle;
  682.     int FWidth;
  683.     int FHeight;
  684.     HPALETTE FPalette;
  685.     Word FInch;
  686.     int FTempWidth;
  687.     int FTempHeight;
  688.     
  689. protected:
  690.     virtual void __fastcall FreeHandle(void);
  691.     
  692. public:
  693.     __fastcall virtual ~TMetafileImage(void);
  694. public:
  695.     /* TObject.Create */ __fastcall TMetafileImage(void) : Graphics::TSharedImage() { }
  696.     
  697. };
  698.  
  699. class PASCALIMPLEMENTATION TMetafile : public Graphics::TGraphic 
  700. {
  701.     typedef Graphics::TGraphic inherited;
  702.     
  703. private:
  704.     TMetafileImage* FImage;
  705.     bool FEnhanced;
  706.     System::AnsiString __fastcall GetAuthor(void);
  707.     System::AnsiString __fastcall GetDesc(void);
  708.     int __fastcall GetHandle(void);
  709.     Word __fastcall GetInch(void);
  710.     int __fastcall GetMMHeight(void);
  711.     int __fastcall GetMMWidth(void);
  712.     void __fastcall NewImage(void);
  713.     void __fastcall SetHandle(int Value);
  714.     void __fastcall SetInch(Word Value);
  715.     void __fastcall SetMMHeight(int Value);
  716.     void __fastcall SetMMWidth(int Value);
  717.     void __fastcall UniqueImage(void);
  718.     
  719. protected:
  720.     virtual bool __fastcall GetEmpty(void);
  721.     virtual int __fastcall GetHeight(void);
  722.     virtual HPALETTE __fastcall GetPalette(void);
  723.     virtual int __fastcall GetWidth(void);
  724.     virtual void __fastcall Draw(TCanvas* ACanvas, const Windows::TRect &Rect);
  725.     virtual void __fastcall ReadData(Classes::TStream* Stream);
  726.     void __fastcall ReadEMFStream(Classes::TStream* Stream);
  727.     void __fastcall ReadWMFStream(Classes::TStream* Stream, int Length);
  728.     virtual void __fastcall SetHeight(int Value);
  729.     virtual void __fastcall SetTransparent(bool Value);
  730.     virtual void __fastcall SetWidth(int Value);
  731.     bool __fastcall TestEMF(Classes::TStream* Stream);
  732.     virtual void __fastcall WriteData(Classes::TStream* Stream);
  733.     void __fastcall WriteEMFStream(Classes::TStream* Stream);
  734.     void __fastcall WriteWMFStream(Classes::TStream* Stream);
  735.     
  736. public:
  737.     __fastcall virtual TMetafile(void);
  738.     __fastcall virtual ~TMetafile(void);
  739.     void __fastcall Clear(void);
  740.     virtual void __fastcall LoadFromStream(Classes::TStream* Stream);
  741.     virtual void __fastcall SaveToFile(const System::AnsiString Filename);
  742.     virtual void __fastcall SaveToStream(Classes::TStream* Stream);
  743.     virtual void __fastcall LoadFromClipboardFormat(Word AFormat, int AData, HPALETTE APalette);
  744.     virtual void __fastcall SaveToClipboardFormat(Word &AFormat, int &AData, HPALETTE &APalette);
  745.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  746.     int __fastcall ReleaseHandle(void);
  747.     __property System::AnsiString CreatedBy = {read=GetAuthor};
  748.     __property System::AnsiString Description = {read=GetDesc};
  749.     __property bool Enhanced = {read=FEnhanced, write=FEnhanced, default=1};
  750.     __property int Handle = {read=GetHandle, write=SetHandle, nodefault};
  751.     __property int MMWidth = {read=GetMMWidth, write=SetMMWidth, nodefault};
  752.     __property int MMHeight = {read=GetMMHeight, write=SetMMHeight, nodefault};
  753.     __property Word Inch = {read=GetInch, write=SetInch, nodefault};
  754. };
  755.  
  756. class DELPHICLASS TIconImage;
  757. class PASCALIMPLEMENTATION TIconImage : public Graphics::TSharedImage 
  758. {
  759.     typedef Graphics::TSharedImage inherited;
  760.     
  761. private:
  762.     HICON FHandle;
  763.     Classes::TCustomMemoryStream* FMemoryImage;
  764.     
  765. protected:
  766.     __fastcall virtual ~TIconImage(void);
  767.     virtual void __fastcall FreeHandle(void);
  768. public:
  769.     /* TObject.Create */ __fastcall TIconImage(void) : Graphics::TSharedImage() { }
  770.     
  771. };
  772.  
  773. class PASCALIMPLEMENTATION TIcon : public Graphics::TGraphic 
  774. {
  775.     typedef Graphics::TGraphic inherited;
  776.     
  777. private:
  778.     TIconImage* FImage;
  779.     HICON __fastcall GetHandle(void);
  780.     void __fastcall HandleNeeded(void);
  781.     void __fastcall ImageNeeded(void);
  782.     void __fastcall NewImage(HICON NewHandle, Classes::TMemoryStream* NewImage);
  783.     void __fastcall SetHandle(HICON Value);
  784.     
  785. protected:
  786.     virtual void __fastcall Draw(TCanvas* ACanvas, const Windows::TRect &Rect);
  787.     virtual bool __fastcall GetEmpty(void);
  788.     virtual int __fastcall GetHeight(void);
  789.     virtual int __fastcall GetWidth(void);
  790.     virtual void __fastcall SetHeight(int Value);
  791.     virtual void __fastcall SetTransparent(bool Value);
  792.     virtual void __fastcall SetWidth(int Value);
  793.     virtual void __fastcall LoadFromClipboardFormat(Word AFormat, int AData, HPALETTE APalette);
  794.     virtual void __fastcall SaveToClipboardFormat(Word &Format, int &Data, HPALETTE &APalette);
  795.     
  796. public:
  797.     __fastcall virtual TIcon(void);
  798.     __fastcall virtual ~TIcon(void);
  799.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  800.     virtual void __fastcall LoadFromStream(Classes::TStream* Stream);
  801.     HICON __fastcall ReleaseHandle(void);
  802.     virtual void __fastcall SaveToStream(Classes::TStream* Stream);
  803.     __property HICON Handle = {read=GetHandle, write=SetHandle, nodefault};
  804. };
  805.  
  806. //-- var, const, procedure ---------------------------------------------------
  807. #define clScrollBar (TColor)(0x80000000)
  808. #define clBackground (TColor)(-2147483647)
  809. #define clActiveCaption (TColor)(-2147483646)
  810. #define clInactiveCaption (TColor)(-2147483645)
  811. #define clMenu (TColor)(-2147483644)
  812. #define clWindow (TColor)(-2147483643)
  813. #define clWindowFrame (TColor)(-2147483642)
  814. #define clMenuText (TColor)(-2147483641)
  815. #define clWindowText (TColor)(-2147483640)
  816. #define clCaptionText (TColor)(-2147483639)
  817. #define clActiveBorder (TColor)(-2147483638)
  818. #define clInactiveBorder (TColor)(-2147483637)
  819. #define clAppWorkSpace (TColor)(-2147483636)
  820. #define clHighlight (TColor)(-2147483635)
  821. #define clHighlightText (TColor)(-2147483634)
  822. #define clBtnFace (TColor)(-2147483633)
  823. #define clBtnShadow (TColor)(-2147483632)
  824. #define clGrayText (TColor)(-2147483631)
  825. #define clBtnText (TColor)(-2147483630)
  826. #define clInactiveCaptionText (TColor)(-2147483629)
  827. #define clBtnHighlight (TColor)(-2147483628)
  828. #define cl3DDkShadow (TColor)(-2147483627)
  829. #define cl3DLight (TColor)(-2147483626)
  830. #define clInfoText (TColor)(-2147483625)
  831. #define clInfoBk (TColor)(-2147483624)
  832. #define clBlack (TColor)(0)
  833. #define clMaroon (TColor)(128)
  834. #define clGreen (TColor)(32768)
  835. #define clOlive (TColor)(32896)
  836. #define clNavy (TColor)(8388608)
  837. #define clPurple (TColor)(8388736)
  838. #define clTeal (TColor)(8421376)
  839. #define clGray (TColor)(8421504)
  840. #define clSilver (TColor)(12632256)
  841. #define clRed (TColor)(255)
  842. #define clLime (TColor)(65280)
  843. #define clYellow (TColor)(65535)
  844. #define clBlue (TColor)(16711680)
  845. #define clFuchsia (TColor)(16711935)
  846. #define clAqua (TColor)(16776960)
  847. #define clLtGray (TColor)(12632256)
  848. #define clDkGray (TColor)(8421504)
  849. #define clWhite (TColor)(16777215)
  850. #define clNone (TColor)(536870911)
  851. #define clDefault (TColor)(536870912)
  852. #define cmBlackness (Byte)(66)
  853. #define cmDstInvert (int)(5570569)
  854. #define cmMergeCopy (int)(12583114)
  855. #define cmMergePaint (int)(12255782)
  856. #define cmNotSrcCopy (int)(3342344)
  857. #define cmNotSrcErase (int)(1114278)
  858. #define cmPatCopy (int)(15728673)
  859. #define cmPatInvert (int)(5898313)
  860. #define cmPatPaint (int)(16452105)
  861. #define cmSrcAnd (int)(8913094)
  862. #define cmSrcCopy (int)(13369376)
  863. #define cmSrcErase (int)(4457256)
  864. #define cmSrcInvert (int)(6684742)
  865. #define cmSrcPaint (int)(15597702)
  866. #define cmWhiteness (int)(16711778)
  867. extern PACKAGE TFontData DefFontData;
  868. extern PACKAGE HPALETTE SystemPalette16;
  869. extern PACKAGE bool DDBsOnly;
  870. extern PACKAGE void __fastcall PaletteChanged(void);
  871. extern PACKAGE int __fastcall ColorToRGB(TColor Color);
  872. extern PACKAGE System::AnsiString __fastcall ColorToString(TColor Color);
  873. extern PACKAGE TColor __fastcall StringToColor(const System::AnsiString S);
  874. extern PACKAGE void __fastcall GetColorValues(Classes::TGetStrProc Proc);
  875. extern PACKAGE bool __fastcall ColorToIdent(int Color, System::AnsiString &Ident);
  876. extern PACKAGE bool __fastcall IdentToColor(const System::AnsiString Ident, int &Color);
  877. extern PACKAGE void __fastcall GetCharsetValues(Classes::TGetStrProc Proc);
  878. extern PACKAGE bool __fastcall CharsetToIdent(int Charset, System::AnsiString &Ident);
  879. extern PACKAGE bool __fastcall IdentToCharset(const System::AnsiString Ident, int &Charset);
  880. extern PACKAGE bool __fastcall TransparentStretchBlt(HDC DstDC, int DstX, int DstY, int DstW, int DstH
  881.     , HDC SrcDC, int SrcX, int SrcY, int SrcW, int SrcH, HDC MaskDC, int MaskX, int MaskY);
  882. extern PACKAGE void __fastcall GetDIBSizes(HBITMAP Bitmap, int &InfoHeaderSize, int &ImageSize);
  883. extern PACKAGE bool __fastcall GetDIB(HBITMAP Bitmap, HPALETTE Palette, void *BitmapInfo, void *Bits
  884.     );
  885. extern PACKAGE void __fastcall FreeMemoryContexts(void);
  886. extern PACKAGE HBITMAP __fastcall CreateMappedBmp(HBITMAP Handle, const TColor * OldColors, const int 
  887.     OldColors_Size, const TColor * NewColors, const int NewColors_Size);
  888. extern PACKAGE HBITMAP __fastcall CreateMappedRes(int Instance, char * ResName, const TColor * OldColors
  889.     , const int OldColors_Size, const TColor * NewColors, const int NewColors_Size);
  890. extern PACKAGE HBITMAP __fastcall CreateGrayMappedBmp(HBITMAP Handle);
  891. extern PACKAGE HBITMAP __fastcall CreateGrayMappedRes(int Instance, char * ResName);
  892. extern PACKAGE HPALETTE __fastcall CopyPalette(HPALETTE Palette);
  893. extern PACKAGE System::AnsiString __fastcall GraphicFilter(System::TMetaClass* GraphicClass);
  894. extern PACKAGE System::AnsiString __fastcall GraphicExtension(System::TMetaClass* GraphicClass);
  895. extern PACKAGE System::AnsiString __fastcall GraphicFileMask(System::TMetaClass* GraphicClass);
  896. extern PACKAGE TFontCharset __fastcall GetDefFontCharSet(void);
  897.  
  898. }    /* namespace Graphics */
  899. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  900. using namespace Graphics;
  901. #endif
  902. //-- end unit ----------------------------------------------------------------
  903. #endif    // Graphics
  904.